import Vue from 'vue';

export const Video = {
  async info (vid) {
    let data = await Vue.prototype.$axios.post(`api/video/info`, { vid });
    return data;
  },
  async favorite (vid, favorite) {
    let data = await Vue.prototype.$axios.post(`api/video/favorite`, { vid, favorite });
    return !!data;
  },
  async hot (count) {
    let data = await Vue.prototype.$axios.post(`api/video/hot`, { count });
    return data;
  },
  async latest (count) {
    let data = await Vue.prototype.$axios.post(`api/video/latest`, { count });
    return data;
  }
}
